package com.itheima.controller;

import com.itheima.entity.Account;
import com.itheima.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;

@Controller
public class AccountController {

    // 这个属性需要依赖注入,使用自动装配
    @Autowired
    private AccountService accountService;

    private String[] name;

    public void setAccountService(AccountService accountService) {
        this.accountService = accountService;
    }

    public void save(Account account) {
        accountService.save(account);
    }
}
